package com.dbs.donatebooksystem.Service.impl;

import com.dbs.donatebooksystem.Service.AddressService;
import com.dbs.donatebooksystem.mapper.AddressMapper;
import com.dbs.donatebooksystem.pojo.Address;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class AddressServiceImpl implements AddressService {

    @Autowired
    private AddressMapper addressMapper;
    @Override
    public List<Address> getAddress(int id) {
        return addressMapper.selectAddressById(id);
    }

    @Override
    public void insertAddress(int id, Address address) {
        addressMapper.insertAddress(id,address);
    }

    @Override
    public void updateAddress(Address address) {
        addressMapper.updateAddress(address);
    }

    @Override
    public void deleteAddress(Integer id) {
        addressMapper.deleteAddress(id);
    }
}
